/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package it.tukano.swingdeco.containers;

import it.tukano.swingdeco.ExtUtilities;
import java.awt.Component;
import javax.swing.JDialog;
import javax.swing.JOptionPane;

/**
 *
 * @author utente4
 */
public class JDialogExt extends JDialog {
    //Default serial version code
    private static final long serialVersionUID = 0;
    
    public JDialogExt(Component parent) {
        super(JOptionPane.getFrameForComponent(parent));
        setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    }

    public void packAndShow() {
        pack();
        ExtUtilities.center(this.getOwner(), this);
        setVisible(true);
    }
}
